<template>
  <div>
    <div>
      <el-table :data="orders" style="width: 100%; height:3000px;" width="formlabelwidth">
        <el-table-column label="序号" type="index" />
        <el-table-column label="订单编号" prop="id" />
        <el-table-column label="订单科目" prop="orderLines[0].product.name" />
        <el-table-column label="科任教师" prop="name">
          <template v-slot="scope">
            <div>
              {{ scope.row.employee.realname || "-" }}
            </div>
          </template>
        </el-table-column>
        <el-table-column label="操作">
          <template v-slot="scope">
            <el-link type="primary" style="margin-right: 10px;" @click="seeComment(scope.row)">查看评论</el-link>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <!-- 模态框 -->
    <el-dialog title="提示" :visible.sync="dialog" width="50%" >
      <div>
        <el-table :data="form.comments" style="width: 100%; height:400px;" >
          {{ form.comments }}
          <el-table-column label="顾客编号" prop="customerId" width="100px"/>
          <el-table-column label="评论内容" prop="content" width="600px" />
          <el-table-column label="评论时间" prop="commentTime">
          </el-table-column>
          <el-table-column label="评论状态" prop="status" />
          <el-table-column label="操作">
          <template v-slot="scope">
            <el-link type="primary" style="margin-right: 10px;" >审核</el-link>
            <el-link type="primary" style="margin-right: 10px;" >删除</el-link>
          </template>
        </el-table-column>
        </el-table>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialog = false">取 消</el-button>
        <el-button type="primary" @click="dialog = false">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
import { get, post } from '@/utils/request.js'
export default {
  data() {
    return {
      params: {
        page: 1,
        pageSize: 10
      },
      form: {},
      orders: [],
      // form: {},
      localCategory: {},
      dialog: false,
      formLabelWidth: '400px',
      timer: null,
      title: '新增栏目'
    }
  },
  methods: {
    // 打开评论
    seeComment(row) {
      this.dialog = true
      this.form = { ...row }
      console.log(this.form);
    },
    // 查询订单
    async getOrder() {
      const res = await get('/order/pageQuery', this.params)
      console.log(res, '123456')
      this.orders = res.data.list
    },
  },
  created() {
    this.getOrder()
  },
}
</script>
